package com.neusoft.shopping.manager.controller;
import com.neusoft.shopping.manager.entity.BusinesEntity;
import com.neusoft.shopping.manager.service.BusinesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class BusinesController {
    @Autowired
     BusinesService service;
    @RequestMapping("/loging")
    public String  loging(BusinesEntity busines){
            String acount=busines.getAccount();
            String password=busines.getPassword();
            BusinesEntity user=service.login(acount,password);
            if(null!=user){
                return "forward:home";
            }
        return "forward:";
    }
    @RequestMapping("/home")
    public ModelAndView home_show(){
        ModelAndView modelAndView=new ModelAndView();

        modelAndView.setViewName("home");
        return modelAndView;
    }
}
